<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 300px;
      height: 300px;
      background-color: pink;
    }

    input {
      vertical-align: top;
    }
  </style>
</head>
<body>
  <!-- 解决div中的文本框无法贴顶问题 -->
  <div>
    <input type="text" name="" id="">
  </div>
</body>
</html>